﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TouchSocket.Dmtp.Rpc;
using TouchSocket.Rpc;

namespace Teriri.File.Client.Function
{
    public static class AuthFunction
    {
        public static bool Login(string remoteIPHost, string verifyToken, string userId, string pwd)
        {
            var client = RpcClientHelper.GetClient(remoteIPHost, verifyToken);
            var res = client.GetDmtpRpcActor().InvokeResult<bool>("Login", userId, pwd);
            if (res.Succ == false)
                throw new Exception(res.Message);

            return res.Result;
        }
    }
}
